<script setup>
import '../../assets/data'
import axios from 'axios'
import { ref, onMounted } from 'vue'
import QRcode from 'qrcode'
let arr = ref(null)
onMounted(() => {
    axios.get('/api/dingdanchi').then(res => {
        arr.value = res.data.data
    })
})



</script>

<template>
    <div class="cc">
        <div class="tt" v-for="(item, index) in arr" :key="index">
            <div class="ding">订单编号：{{ item.bianhao }}</div>
            <div class="xian"></div>
            <div class="neo1">
                <div class="neo2">
                    <div class="shou">收</div>
                    <div class="song">{{ item.name[index] }}</div>
                    <div class="jiao">{{ item.dizhi }}</div>
                </div>
                <div class="neo3">
                    <div class="shou">接</div>
                    <div class="song">{{ item.name[index + 1] }}</div>
                    <div class="jiao">{{ item.dizhi }}</div>
                </div>
                <div class="qiang">
                    <button class="dan">抢单</button>
                </div>
            </div>
        </div>
        <div class="tt" v-for="(item, inded) in arr" :key="inded">
            <div class="ding">订单编号：{{ item.bianhao }}</div>
            <div class="xian"></div>
            <div class="neo1">
                <div class="neo2">
                    <div class="shou">收</div>
                    <div class="song">{{ item.name[inded] }}</div>
                    <div class="jiao">{{ item.dizhi }}</div>
                </div>
                <div class="neo3">
                    <div class="shou">接</div>
                    <div class="song">{{ item.name[inded + 1] }}</div>
                    <div class="jiao">{{ item.dizhi }}</div>
                </div>
                <div class="qiang">
                    <button class="dan">抢单</button>
                </div>
            </div>
        </div>
        <div class="jiedan">
            <div>接单中...</div>
            <div class="xiu"><button>我要休息</button></div>
        </div>
    </div>
</template>

<style scoped>
.cc {
    height: 550px;
    width: calc(100% - 20px);
    width: 100%;
}

.tt {
    background-color: white;
    margin: 0 auto;
    height: 165px;
    margin-top: 10px;
}

.ding {
    padding: 20px 15px 10px 30px;
    font-size: 12px;
}

.xian {
    border: #ccc 1px solid;
    width: 280px;
    margin-left: 30px;
}

.neo1 {
    display: flex;
    flex-direction: column;
}

.neo2 {
    display: flex;
    padding: 10px 10px 0 30px;
}

.shou {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    text-align: center;
    font-size: 13px;
    background-color: #1a94bc;
    color: white;
}

.song {
    font-size: 13px;
    margin-left: 25px;
}

.jiao {
    color: #a1a1a1;
    font-size: 13px;
    margin-left: 25px;
}

.neo3 {
    display: flex;
    padding: 10px 10px 10px 30px;
}

.qiang {
    margin-left: 100px;
}

.dan {
    width: 130px;
    height: 30px;
    border: none;
    background-color: #1a94bc;
    color: white;
    border-radius: 5px;
}

.jiedan {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: rgba(21, 221, 74, 0.752);
    height: 40px;
    padding: 10px;
    margin-top: 150px;
}

.xiu>button {
    border: none;
    background-color: #fa7e23;
    color: white;
    width: 100px;
    height: 25px;
    border-radius: 5px;
}
</style>